package gtv.sic.control;

import gtv.sic.R;
import gtv.sic.dao.UsuarioDAO;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;


public class CadastroUsuarioActivity extends Activity {
	private static final String LOGS = "logs";
	private Button cadastrar;
	private Button voltar;
	
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.form_usuario);

        cadastrar = (Button) findViewById(R.id.buttonCadastrar);
        voltar = (Button) findViewById(R.id.buttonVoltar);
        
        cadastrar.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				UsuarioDAO dao = UsuarioDAO.getInstance();
				Integer tam = dao.getUsuarios().size();
				Log.v(LOGS, tam.toString());
				Intent intent = new Intent(CadastroUsuarioActivity.this, MenuPrincipalActivity.class);
				
				startActivity(intent);
			}
		});      
        
        voltar.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				Intent intent = new Intent(CadastroUsuarioActivity.this, SiCActivity.class);
				
				startActivity(intent);
			}
		});       
        
    }
}